/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2025-09-14
 * Time: 13:48
 */
public class demo2 {
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 5; i++) {
            int factoryResult = 1;
            for (int j = 1; j <= i; j++) {
                factoryResult *= j;
            }
            sum += factoryResult;
        }
        System.out.println(sum);
    }
}
